package service

import (
	"BiYeProServer/src/model"
	"BiYeProServer/src/model/dao"
	"BiYeProServer/src/util"
	"github.com/gin-gonic/gin"
)

func GetMatches(ctx *gin.Context)  {
	var matches []model.Match
	dao.GetDb().Find(&matches).Limit(10)
	if len(matches) == 0{
		util.SetResponse(ctx,5005,false,nil,"获取比赛信息失败")
		return
	}
	util.SetResponse(ctx,200,true,matches,"获取比赛信息成功")
}
